home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Utilities / Disk / CMInstall / CLIMasterII / modules / cmhelp.g < prev    next >
Encoding:
Gui4CLI script  |  1998-06-24  |  2.9 KB  |  167 lines

  1. G4C
  2.  
  3. winbig -1 -1 240 113 ""
  4. wintype 11010001
  5. usetopaz
  6. varpath "hlpvwr.g/climaster"
  7.  
  8. xonload
  9. guide = "cmst:CLIMaster.guide"
  10. guiopen cmhelp.g
  11.  
  12. xonopen
  13. lvuse cmhelp.g 1
  14. run 'resident cmst:bin/writenode pure add'
  15. cli 'cmst:bin/getnodes $guide cmst:config/climaster.guide.idx'
  16. lvchange cmst:config/climaster.guide.idx
  17. lvdel 0
  18. extract guide file wtitle
  19. extract wtitle unquote wtitle
  20. setwintitle cmhelp.g "$wtitle                      "
  21.  
  22. xonkey #v
  23. xonkey #r
  24. if $$rawkey.code = 78
  25.     lvuse cmhelp.g 1
  26.     lvmove 1
  27. elseif $$rawkey.code = 79
  28.     lvuse cmhelp.g 1
  29.     lvmove -1
  30. endif
  31.  
  32. xonclose
  33. gosub cmhelp.g exit
  34.  
  35. xtextin 0 0 220 13   "" txt "" 80
  36. if $txt > ''
  37.     lvuse cmhelp.g 1
  38.     lvsearch $txt ci first
  39. endif
  40. gosub cmhelp.g search_update
  41.  
  42. xbutton 220 0 20 13 ยป
  43. if $txt > ''
  44.    lvuse cmhelp.g 1
  45.    lvsearch $txt ci next
  46. endif
  47. gosub cmhelp.g search_update
  48.  
  49. xlistview 0 13 240 100  '' topic '' 0 txt
  50. gadid 1
  51. gosub cmhelp.g fetchtext
  52.  
  53. xroutine fetchtext
  54. cutvar topic cut word -2 offset
  55. extract topic upper topic
  56. extract topic unquote topic
  57. cli 'writenode $guide $offset'
  58. ifexists window hlpvwr.g
  59.     guiwindow hlpvwr.g front
  60.     guiwindow hlpvwr.g on
  61. else
  62.     guiopen hlpvwr.g
  63. endif
  64. gosub hlpvwr.g switchgads
  65. update hlpvwr.g 2 "Subject: $topic"
  66. set translation off
  67. lvuse hlpvwr.g 1
  68. lvchange ram:guide.txt
  69.  
  70. xroutine search_update
  71. if $$lv.line > ''
  72.     update cmhelp.g 1 $$lv.line
  73. else
  74.     lvgo #0
  75.     update cmhelp.g 1 0
  76. endif
  77.  
  78. xroutine exit
  79. run 'resident writenode remove'
  80. ifexists file ram:guide.txt
  81.     delete ram:guide.txt
  82. endif
  83. lvuse climaster $cm_srce
  84. guiquit hlpvwr.g 
  85. guiquit cmhelp.g   
  86.  
  87. ;--------------------------------------------------------------
  88.  
  89. newfile hlpvwr.g
  90.  
  91. winbig -1 -1 600 192 "CLIMaster Help System"
  92. winsmall 0 -1 600 192
  93. wintype 11110001
  94. varpath "cmhelp.g"
  95.  
  96. xonclose
  97. set translation on
  98. lvuse hlpvwr.g 1
  99. lvclear
  100. gosub cmhelp.g exit
  101.  
  102. xonrmb
  103. set translation on
  104. lvuse hlpvwr.g 1
  105. lvclear
  106. ifexists window cmhelp.g
  107.     update hlpvwr.g 2 ""
  108.     guiwindow cmhelp.g front
  109.     guiwindow cmhelp.g on
  110. else
  111.     guiclose hlpvwr.g
  112. endif
  113.  
  114. box 0 0 450 12 out button
  115.  
  116. xlistview 0 12 0 180 "" "" "" 20 num
  117. gadid  1
  118. gadfont topaz.font 8 000
  119.  
  120. text 10 0 450 12 "" 50 nobox
  121. gadid 2
  122.  
  123. xbutton 450 0 50 12 Prev
  124. gadid 4
  125. lvuse cmhelp.g 1
  126. if $$lv.line != 0
  127.     setgad hlpvwr.g 4 on
  128.     setgad hlpvwr.g 5 on
  129.     lvgo prev
  130.     topic = $$lv.rec
  131.     gosub hlpvwr.g switchgads
  132.     gosub cmhelp.g fetchtext
  133. endif
  134.  
  135. xbutton 500 0 50 12 Next
  136. gadid 5
  137. lvuse cmhelp.g 1
  138. if $$lv.line != $total
  139.     setgad hlpvwr.g 4 on
  140.     setgad hlpvwr.g 5 on
  141.     lvgo next
  142.     topic = $$lv.rec
  143.     gosub hlpvwr.g switchgads
  144.     gosub cmhelp.g fetchtext
  145. endif
  146.  
  147. xbutton 550 0 50 12 Quit
  148. guiclose hlpvwr.g
  149.  
  150. xroutine switchgads
  151. lvuse cmhelp.g 1
  152. total = $$lv.total
  153. counter total dec 1
  154. if $$lv.line = 0
  155.     setgad hlpvwr.g 4 off
  156.     setgad hlpvwr.g 5 on
  157.     return
  158. elseif $$lv.line = $total
  159.     setgad hlpvwr.g 4 on
  160.     setgad hlpvwr.g 5 off
  161.     return
  162. else
  163.     setgad hlpvwr.g 4 on
  164.     setgad hlpvwr.g 5 on
  165.     return
  166. endif
  167.